;实验七
assume cs:codesg
data segment 
	;21年年份
	db '1975','1976','1977','1978','1979','1980','1981','1982','1983','1984','1985','1986','1987','1988','1989','1990'
	db '1991','1992','1993','1994','1995'
	;21年总收入
	dd 16,22,382,1356,2390,8000,16000,24886,50065,97479,140417,197514,345980
	dd 590827,803530,1183000,1843000,2795000,3753000,4649000,5937000
	;21年雇员数
	dw 3,7,9,13,24,44,56,78,99,112,299,450,1200,2389,3000,4011,5099,10999,12899,14000,17800
data ends

table segment
	db 21 dup ('year summ ne ?? ')	;??:平均
table ends 

codesg segment 
start:
	mov ax,data
	mov ds,ax
	
	mov ax,table
	mov es,ax
	mov si,0
	mov bx,0 
	mov di,0
	
	mov cx,21
lo:	mov ax,ds:[si]			;19
	mov es:[si+bx],ax 			
	mov ax,ds:[si+2]			;75
	mov es:[si+bx+2],ax
	;mov al,' '
	;mov es:[4],al 
	mov ax,ds:[84+0+si]			;16;22 
	mov dx,ds:[84+2+si]			;0 ;0
	mov es:[bx+si+5],ax				;被除数低位放到table里
	mov es:[bx+si+7],dx				;被除数高位放到table里
	div word ptr ds:[84+84+di]	;除之
	mov es:[13+bx+si],ax				;整数商放于ax，后移动对应内存位置(table的??位置)
	;mov al,' '
	;mov es:[9],al
	mov ax,ds:[84+84+di]
	mov es:[10+bx+si],ax
	add si,4
	add bx,12
	add di,2
	loop lo 
	;mov al,' '
	;mov es:[12],al
	
	mov ax,4c00h
	int 21h

codesg ends

end start